Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Getting and Playing Movies / Saving Movies


NewMovieFromDataFork

The NewMovieFromDataFork function enables you to retrieve a movie that is stored anywhere in the data fork of a specified file.

pascal OSErr NewMovieFromDataFork (Movie *theMovie, 
                                    short fRefNum, 
                                    long fileOffset, 
                                    short newMovieFlags, 
                                    Boolean *dataRefWasChanged);
theMovie
Contains a pointer to the movie identifier for the movie to be retrieved. Your application obtains this movie identifier from such functions as NewMovie, NewMovieFromFile, and NewMovieFromHandle (described on page 2-80, page 2-76, and page 2-78, respectively).
fRefNum
Contains a file reference number to a file that is already open.
fileOffset

Specifies the starting file offset of the atom in the data fork of the
file specified by the fRefNum parameter.
newMovieFlags
Contains the standard flags in the newMovie enumeration.
newMovieActive
Controls whether the new movie is active. Set this flag to 1 to make the new movie active. A movie that does not have any tracks can still be active. When the Movie Toolbox tries to play the movie, no images are displayed, because there is no movie data. You can make a movie active or inactive by calling the SetMovieActive function, which is described on page 2-131.
newMovieDontAutoAlternate
Controls whether the Movie Toolbox automatically selects enabled tracks from alternate track groups. If you set this flag to 1, the Movie Toolbox does not automatically select tracks for the movie--you must enable tracks yourself.
newMovieDontResolveDataRefs
Controls how completely the Movie Toolbox resolves data references in the movie resource. If you set this flag to 0, the toolbox tries to completely resolve all data references in the resource. This may involve searching for files on remote volumes. If you set this flag to 1, the Movie Toolbox only looks in the specified file.
If the Movie Toolbox cannot completely resolve all the data references, it still returns a valid movie identifier. In this case, the Movie Toolbox also sets the current error value to couldNotResolveDataRef.
newMovieDontAskUnresolvedDataRefs
Controls whether the Movie Toolbox asks the user to locate files. If you set this flag to 0, the Movie Toolbox asks the user to locate files that it cannot find on available volumes. If the Movie Toolbox cannot locate a file even with the user's help, the function returns a valid movie identifier and sets the current error value to couldNotResolveDataRef.
dataRefWasChanged
Contains a pointer to a Boolean value. The Movie Toolbox sets the Boolean to indicate whether it had to change any data references while resolving them. The toolbox sets the Boolean value to true if any references were changed. Use the UpdateMovieResource function (described on page 2-91) to preserve these changes.
Set the dataRefWasChanged parameter to nil if you do not want to receive this information. See the "Creating Tracks and Media Structures" beginning on page 2-136 for more information about data references.
ERROR CODES
badImageDescription-2001Problem with an image description
badPublicMovieAtom-2002Movie file corrupted
cantFindHandler-2003Cannot locate a handler
cantOpenHandler-2004Cannot open a handler
File Manager errors
Memory Manager errors


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996